The invention relates to microcontrollers, and more particularly, to a microcontroller having an integral switch mode power supply controller for controlling the charging circuits of a battery charger.